<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:if test="${param.size>1 }">
	<nav>
		<ul class="pagination pull-right">
			<li>
				<c:choose>
					<c:when test="${param.start>1 }">
						<a href="${ctx }/${param.url }?start=${param.start-1 }" aria-label="Previous">
							<span aria-hidden="true">&laquo;</span>
						</a>
					</c:when>
					<c:otherwise>
						<a href="javascript:void(0);" aria-label="Previous">
							<span aria-hidden="true">&laquo;</span>
						</a>
					</c:otherwise>
				</c:choose>
			</li>
			<c:choose>
				<c:when test="${param.size<=10 }">
					<c:forEach var="pageIndex" begin="1" end="${param.size }" step="1">
						<li <c:if test="${param.start==pageIndex }">class="active"</c:if>><a href="${ctx }/${param.url }?start=${pageIndex }">${pageIndex }</a></li>
					</c:forEach>
				</c:when>
				<c:otherwise>
					<c:choose>
						<c:when test="${param.start < 4 }">
							<li <c:if test="${param.start==1 }">class="active"</c:if>><a href="${ctx }/${param.url }?start=1">1</a></li>
							<li <c:if test="${param.start==2 }">class="active"</c:if>><a href="${ctx }/${param.url }?start=2">2</a></li>
							<li <c:if test="${param.start==3 }">class="active"</c:if>><a href="${ctx }/${param.url }?start=3">3</a></li>
							<li <c:if test="${param.start==4 }">class="active"</c:if>><a href="${ctx }/${param.url }?start=4">4</a></li>
							<li><a href="javascript:void(0);">...</a></li>
							<li><a href="${ctx }/${param.url }?start=${param.size-1 }">${param.size-1 }</a></li>
							<li><a href="${ctx }/${param.url }?start=${param.size}">${param.size }</a></li>
						</c:when>
						<c:when test="${param.start > param.size-3 }">
							<li><a href="${ctx }/${param.url }?start=1">1</a></li>
							<li><a href="${ctx }/${param.url }?start=2">2</a></li>
							<li><a href="javascript:void(0);">...</a></li>
							<li <c:if test="${param.start==param.size-3 }">class="active"</c:if>><a href="${ctx }/${param.url }?start=${param.size-3 }">${param.size-3 }</a></li>
							<li <c:if test="${param.start==param.size-2 }">class="active"</c:if>><a href="${ctx }/${param.url }?start=${param.size-2 }">${param.size-2 }</a></li>
							<li <c:if test="${param.start==param.size-1 }">class="active"</c:if>><a href="${ctx }/${param.url }?start=${param.size-1 }">${param.size-1 }</a></li>
							<li <c:if test="${param.start==param.size }">class="active"</c:if>><a href="${ctx }/${param.url }?start=${param.size}">${param.size }</a></li>
						</c:when>
						<c:otherwise>
							<li><a href="${ctx }/${param.url }?start=1">1</a></li>
							<li><a href="${ctx }/${param.url }?start=2">2</a></li>
							<li><a href="javascript:void(0);">...</a></li>
							<li><a href="${ctx }/${param.url }?start=${param.start-1 }">${param.start-1 }</a></li>
							<li class="active"><a href="${ctx }/${param.url }?start=${param.start }">${param.start }</a></li>
							<li><a href="${ctx }/${param.url }?start=${param.start+1 }">${param.start+1 }</a></li>
							<li><a href="javascript:void(0);">...</a></li>
							<li><a href="${ctx }/${param.url }?start=${param.size-1 }">${param.size-1 }</a></li>
							<li><a href="${ctx }/${param.url }?start=${param.size}">${param.size }</a></li>
						</c:otherwise>
					</c:choose>
				</c:otherwise>
			</c:choose>
			<li>
				<c:choose>
					<c:when test="${param.size-param.start > 0}">
						<a href="${ctx }/${param.url }?start=${param.start+1 }" aria-label="Next">
							<span aria-hidden="true">&raquo;</span>
						</a>
					</c:when>
					<c:otherwise>
						<a href="javascript:void(0);" aria-label="Next">
							<span aria-hidden="true">&raquo;</span>
						</a>
					</c:otherwise>
				</c:choose>
			</li>
		</ul>
	</nav>
</c:if>